/*
 * WorkspaceTools.cpp
 *
 *  Created on: 2 mars 2013
 *      Author: Raphaël
 */

#include <iostream>
#include <climits>
#include <cfloat>
#include <iomanip>
#include "SystemTools.h"
#include "WorkspaceTools.h"

namespace raph
{
void WorkspaceTools::info()
    {
    std::cout << "Number of cores : " << SystemTools::getNbCores() << std::endl;
    std::cout << "" << std::endl;
    std::cout << "T_FLOAT128 : " << (sizeof(type::T_FLOAT128)) << " bytes, mantissa digits = "
            << LDBL_MANT_DIG << std::endl;
    std::cout << "MAX VALUE = " << LDBL_MAX << std::endl;
    std::cout << "MIN VALUE = " << LDBL_MIN << std::endl << std::endl;

    std::cout << "T_FLOAT64  : " << (sizeof(type::T_FLOAT64)) << " bytes,  mantissa digits = "
            << DBL_MANT_DIG << std::endl;
    std::cout << "MAX VALUE = " << DBL_MAX << std::endl;
    std::cout << "MIN VALUE = " << DBL_MIN << std::endl << std::endl;

    std::cout << "T_FLOAT32   : " << (sizeof(type::T_FLOAT32)) << " bytes,  mantissa digits = "
            << FLT_MANT_DIG << std::endl;
    std::cout << "MAX VALUE = " << FLT_MAX << std::endl;
    std::cout << "MIN VALUE = " << FLT_MIN << std::endl << std::endl;

    std::cout << "T_UINT64  : " << (sizeof(type::T_UINT64)) << " bytes" << std::endl;
    std::cout << "MAX VALUE = " << ULLONG_MAX << std::endl;
    std::cout << "MIN VALUE = " << 0 << std::endl << std::endl;

    std::cout << "T_INT64   : " << (sizeof(type::T_INT64)) << " bytes" << std::endl;
    std::cout << "MAX VALUE = " << LLONG_MAX << std::endl;
    std::cout << "MIN VALUE = " << LLONG_MIN << std::endl << std::endl;

    std::cout << "T_UINT32  : " << (sizeof(type::T_UINT32)) << " bytes" << std::endl;
    std::cout << "MAX VALUE = " << ULONG_MAX << std::endl;
    std::cout << "MIN VALUE = " << 0 << std::endl << std::endl;

    std::cout << "T_INT32   : " << (sizeof(type::T_INT32)) << " bytes" << std::endl;
    std::cout << "MAX VALUE = " << LONG_MAX << std::endl;
    std::cout << "MIN VALUE = " << LONG_MIN << std::endl << std::endl;

    std::cout << "T_UINT16  : " << (sizeof(type::T_UINT16)) << " bytes" << std::endl;
    std::cout << "MAX VALUE = " << USHRT_MAX << std::endl;
    std::cout << "MIN VALUE = " << 0 << std::endl << std::endl;

    std::cout << "T_INT16   : " << (sizeof(type::T_INT16)) << " bytes" << std::endl;
    std::cout << "MAX VALUE = " << SHRT_MAX << std::endl;
    std::cout << "MIN VALUE = " << SHRT_MIN << std::endl << std::endl;

    std::cout << "T_UINT8   : " << (sizeof(type::T_UINT8)) << " bytes" << std::endl;
    std::cout << "MAX VALUE = " << UCHAR_MAX << std::endl;
    std::cout << "MIN VALUE = " << 0 << std::endl << std::endl;

    std::cout << "T_INT8    : " << (sizeof(type::T_INT8)) << " bytes" << std::endl;
    std::cout << "MAX VALUE = " << CHAR_MAX << std::endl;
    std::cout << "MIN VALUE = " << CHAR_MIN << std::endl << std::endl;
    }

void WorkspaceTools::title(const char* msg)
    {
    std::cout << "********************| " << msg << " |*****************" << std::endl;
    }
} /* namespace findPrimeNumbers */
